<?php

namespace App\Models\V1;

use Zizaco\Entrust\EntrustRole;

class Role extends EntrustRole
{

    /**
     * 可被批量赋值字段（白名单）
     *
     * @var array
     */
    protected $fillable = [
        'name', 'display_name','description'
    ];

    /***
     * 获取角色的权限
     * @return \Illuminate\Database\Eloquent\Relations\HasMany
     */
    public function permissions()
    {
        return $this->belongsToMany(Permission::class,'permission_role');
    }

}
